Laboratory 5
CSSE 432 - Computer Networks

Due: Monday, April 23, 2012 by 11:55 PM

Purpose

Learn how to send files to a remote server.

Instructions

  1. Checkout the project Lab05 from your svn repository (svn update should do the trick if you checked out your entire repository in Lab01). Write your solutions to the problem below in that folder.

  2. Modify your previous lab assignment (Lab04) to handle PUT file requests, in addition to the GET and ECHO requests.

    For this assignment assume that all packets are sent correctly. The name of the file should be sent in the data field of the PUT request. The server will create a file with that name and fill it with the data packets you send.

    In order to make sure that the server is willing to process the PUT request, you should wait until the server sends an ACK before starting to send any packets of data. The server will acknowledge each fifth DATA packet. Remember to send an ACK after transmitting all the file packets. The server will send a final ACK to end the file transfer.

    Here is a typical scenario. The numbers are the sequence numbers in the packets:

    Client               Server
    ------               ------
     PUT    ----------->
            <-----------  ACK  0
    DATA  0 ----------->
    DATA  1 ----------->
    DATA  2 ----------->
    DATA  3 ----------->
    DATA  4 ----------->
            <-----------  ACK  4
    DATA  5 ----------->
     ACK  5 ----------->
            <-----------  ACK  5
    
  3. The server programs are available in the Lab05/SERVER folder in your repository.

  4. You should start with your solution to Lab04.

  5. Compile and run the programs in the Linux environment.

  6. Use a consistent set of coding standards. The GNU C coding standards are available at http://www.gnu.org/prep/standards/standards.html#Writing-C Sections to look at are "Comments", "Formatting", "Syntatic Conventions", and "Names".

  7. Submit the source files (.c), the header files (.h) and the Makefile to your svn repository.